package io.renren.modules.aic.service.impl;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.aic.dao.PriceBookDao;
import io.renren.modules.aic.entity.PriceBookEntity;
import io.renren.modules.aic.service.PriceBookService;

import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;


@Service("priceBookService")
public class PriceBookServiceImpl extends ServiceImpl<PriceBookDao, PriceBookEntity> implements PriceBookService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<PriceBookEntity> page = this.selectPage(
                new Query<PriceBookEntity>(params).getPage(),
                new EntityWrapper<PriceBookEntity>().orderBy("create_time", false)
        );

        return new PageUtils(page);
    }

}
